package com.gzk.hrm.context;

import com.alibaba.fastjson.JSON;
import com.gzk.hrm.domain.Login;
import org.springframework.security.core.context.SecurityContextHolder;

public class LoginContext {

    public static Login getLogin(){
        String login = SecurityContextHolder.getContext().getAuthentication().getPrincipal().toString();
        return JSON.parseObject(login, Login.class);
    }
}
